package com.gitee.luosl.cola.lang.function.checked;

import java.util.function.BiFunction;

public interface CheckedBiFunction<T1, T2, R> {

    R apply(T1 t1, T2 t2) throws Throwable;

    default BiFunction<T1, T2, R> toBiFunction() {
        return (t1, t2) -> {
            try {
                return apply(t1, t2);
            }catch (Throwable throwable){
                throw new CheckedException(throwable);
            }
        };
    }
}
